<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Game extends Model
{
    protected $guarded = ["id"];

    // 一对多逆向
    public function type()
    {
        return $this->belongsTo('App\Type');
    }


    // 活动的创建者   一对多逆向
    public function user()
    {
        return $this->belongsTo('App\User');
    }

    // 一对多逆向
    public function Venue()
    {
        return $this->belongsTo('App\Venue');
    }

    // 活动参与的用户  多对多
    public function users(){
        return $this->belongsToMany('App\User',"user_game");
    }

}
